using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using AndyPike.Unfuddle.Contracts;

namespace AndyPike.Unfuddle.Entities.Projects
{
    /// <summary>
    /// Porvides a simple serializable collection of project entities
    /// </summary>
    [XmlRoot("projects")]
    public class ProjectsCollection : IEntity
    {
        /// <summary>
        /// Creates a new ProjectsCollection instance
        /// </summary>
        public ProjectsCollection()
        {
            Projects = new List<Project>();
        }

        /// <summary>
        /// Gets or sets the projects returned from the server
        /// </summary>
        [XmlElement("project")]
        public List<Project> Projects { get; set; }

        /// <summary>
        /// This is not supported for this entity.
        /// </summary>
        /// <param name="context">The entity validation rule to use when checking property values</param>
        public virtual void Validate(EntityValidationContext context)
        {
            throw new NotSupportedException();
        }
    }
}